require "zmq"
require "./types.pb.rb"

context = ZMQ::Context.new(1)

puts "Opening connection for READ"
inbound = context.socket(ZMQ::SUB)
#inbound.connect("tcp://127.0.0.1:9000")
inbound.connect("tcp://0.0.0.0:8888")

inbound.setsockopt(ZMQ::SUBSCRIBE,'')

while true do
	msg = inbound.recv(0)	
	puts "receive resp"
	req = Xlvip::WhiteList::DbReq.new
	req.parse_from_string(msg)
	puts req.gcid

	sleep(1)
end
